package DataReader;

import dataInterpreter.Config;
import dataInterpreter.WeakClassifier;

public class SimulationData implements Comparable {
	public double falsePositiveRate;
	public double missRate;
	public double[] solution;
	public double[][] missTaxFalsePositiveRate;
	public double[] media;
	public double[] desvioPadrao;
	
	public SimulationData(double falsePositive, double missRate, double[] solution)
	{
		media = new double[2];
		desvioPadrao = new double[2];
		this.falsePositiveRate = falsePositive;
		this.missRate = missRate;
		this.solution = new double[solution.length];
		missTaxFalsePositiveRate = new double[Config.NUMBER_OF_SIMULATIONS][2];
		
		for(int i = 0; i < solution.length; i++)
			this.solution[i] = solution[i];
	}
	
	public SimulationData(double[] error, WeakClassifier[] solucao )
	{
		this.missRate = error[0];
		this.falsePositiveRate = error[1];
		this.solution = new double[solucao.length * Config.NUMBER_OF_PARAMETERS];
		
		
	}

	public boolean equals(Object sim)
	{
		SimulationData sd = (SimulationData) sim;
		if(this.missRate == sd.missRate && this.falsePositiveRate == sd.falsePositiveRate)
			return true;
		return false;
	}
	

	@Override
	public int compareTo(Object o) {
		SimulationData sd = (SimulationData) o;
		if(this.falsePositiveRate < sd.falsePositiveRate)
			return -1;
		else if(this.falsePositiveRate > sd.falsePositiveRate)
			return 1;
		else if(this.falsePositiveRate == sd.falsePositiveRate && this.missRate < sd.missRate)
			return -1;
		else if(this.falsePositiveRate == sd.falsePositiveRate && this.missRate > sd.missRate)
			return 1;
		else
			return 0;
	}
	
	
}
